<?php $this->_extends('_layouts/bocib_layout'); ?>

<?php $this->_block('content');?>
<div id="content">
    <?php $newsCtgry =  NewsCategory::find('id = ?', $_GET['id'])->query(); ?>
    <h2>您正在更新分类  : "<?=$newsCtgry->category;?>"</h2>
    <form action="<?=url('bonewsnotice/editnewsctgry');?>" method="post">
        <div>
            把分类 "<?=$newsCtgry->category;?>" 改名为：
            <input type="hidden" name="id" value="<?=$_GET['id'];?>" />
            <input type="text" name="category" value="<?=$newsCtgry->category;?>" /><br />
            <input type="hidden" name="haschild" value="0" />
            <label>父分类:</label>
            <select name="parent_id">
                <option value="<?=$newsCtgry->parent_id;?>">当前为:"
                    <?php
                    if(NewsCategory::find('id = ?', $newsCtgry->parent_id)->query()->category == '')
                    {
                        echo '根分类';
                    }
                    else
                    {
                        echo NewsCategory::find('id = ?', $newsCtgry->parent_id)->query()->category;
                    }
                    ?>
					"</option>
                    <?php foreach(NewsCategory::find('parent_id = 0')->all()->query() as $newsCtgry) { ?>
                    <option value="<?=$newsCtgry->id;?>"><?=$newsCtgry->category;?></option>
                    <?php } ?>
            </select><br />
            <input type="submit" value="确定修改" />
        </div>
    </form>
</div>
<?php $this->_endblock('content');?>